package SubjectInstruction;

use Moose;
use Data::Dumper;


has 'config' => (
    is => 'rw',
    isa => 'HashRef[Str]',
    default => { sub { return { }; } },
    init_arg => undef,
    );


sub get {
    my $self = shift;
    my $name = shift;
    if(exists($self->config->{$name})) {
	return undef;
    }else{
	return $self->config->{$name};
    }
}

sub set_hard {
    my $self = shift;
    my $name = shift;
    my $value = shift;
    $self->config->{$name} = $value;
    return 1;
}

sub set_soft {
    my $self = shift;
    my $name = shift;
    my $ret= 0;
    if(! exists($self->config->{$name})) {
	$self->config->{$name} = $value;
	$ret = 1;
    }
    return $ret;
}

sub print {
    my $self = shift;
    my $ret = '';
    $ret.="$_ = ".$self->config->{$_}."\n" foreach(keys($self->config));
    return $ret;
}

no Moose;
__PACKAGE__->meta->make_immutable;
